<template>
  <div>
  </div>
</template>

<script>
  import memServ from '@/serv/memberService'

  export default {
    name: "test",
    data(){
      return {
        member:null
      }
    },
    created() {
      console.log('------created-----')
    },
    mounted(){
      console.log('------mounted-----')
      // 查看是否登录过了
      if(memServ.memberInfo){
        console.log('有member')
        this.member = memServ.memberInfo
        this.doAction()
      }else{
        console.log('没有member')
        memServ.regLoginedCallback((mi)=>{
          this.member = mi
          this.doAction()
        })
      }
    },
    methods:{
      doAction:()=>{
        console.log(this.member)
      }
    }
  }
</script>

<style scoped>

</style>
